<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="../../org/angular.min.js"></script>
</head>

<body ng-app="app">
    <div ng-controller="ctrl1">
        {{data.name}}
        <div ng-controller="ctrl2">
            <!-- 继承了父作用域的name，但是在文本框输入的时候，只影响子作用域的值，不影响副作用域的值，称为继承隔离 -->
            {{data.name}} <input type="text" ng-model="data.name" id="">
        </div>
    </div>


    <script>
        var m = angular.module('app', []);
        m.controller('ctrl1', ['$scope', function($scope) {
            $scope.data = {
                name: '老周'
            };
        }])
        m.controller('ctrl2', ['$scope', function($scope) {

        }])
    </script>
</body>

</html>
